import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    pageTitle: '' ,
    parentRoute: ''
  },
  getters: {
    pageTitle: state => state.pageTitle,
    parentRoute: state => state.parentRoute  
  },
  mutations: {
    SET_PAGE_TITLE(state, title) {  
      state.pageTitle = title;  
    },
    SET_PAGE_PARENT_ROUTE(state, pageRoute) {  
      state.parentRoute = pageRoute;  
    },
  },
  actions: {
    updatePageTitle({ commit }, title) {  
      commit('SET_PAGE_TITLE', title);  
    },
    updateParentRoute({ commit }, pageRoute) {  
      commit('SET_PAGE_PARENT_ROUTE', pageRoute);  
    } 
  },
  modules: {
  }
})
